package com.example.myapplication.utils;

import android.graphics.Bitmap;
import android.util.Log;
import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.ImageRequest;

import java.util.List;

public class ImageUtils {
    public static void Loadimg(final ImageView view ,String url, RequestQueue queue) {
        final Bitmap map;
        ImageRequest request = new ImageRequest(url ,new Response.Listener<Bitmap>() {
            @Override
            public void onResponse(Bitmap bitmap) {
                view.setImageBitmap(bitmap);
            }
        }, 0, 0, Bitmap.Config.RGB_565, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
                Log.i("aaaaa","报错了......"+volleyError.getMessage());
            }
        });
        queue.add(request);
    }
}
